package com.lwz.laboratory.service;


import com.lwz.laboratory.dao.UserMapper;
import com.lwz.laboratory.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    UserMapper userMapper;

    public void adduser(User user){
        userMapper.insertSelective(user);
    }

    public User checkUser(String userid,String password,String rolename){
        return userMapper.getUserByPwd(userid,password,rolename);
    }

    public User findoneUser(String userid){
        return userMapper.selectByPrimaryKey(userid);
    }

    public void edituser(User user){
        userMapper.updateByPrimaryKeySelective(user);
    }
    public void deluser(String userid){
        userMapper.deleteByPrimaryKey(userid);
    }
}
